package com.lb.undertow.setting.hello;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 发送者
 * @author 001030
 */
@Component
public class HelloSender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendMessage(){
        String content = "hello, 当前时间是"+new Date();
        System.out.println("发送消息"+content);
        //发送消息
        this.amqpTemplate.convertAndSend("hello",content);
    }



}
